<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>确认收货</title>
<jsp:include page="header.jsp"></jsp:include>
</head>
<style type="text/css">
	.weui-content {
		background-color: #fff;
	}
	.my-bar {
		width: 100%;
		height: 42px;
		margin-top: 20px;
	}
	.my-add {
			display: block;
			border: none;
			width: 100%;
			height: 100%;
			line-height: 42px;
			font-size: 21px;
			color: #ffffff;
			text-align:center;
			background-color: red;
		}
		.weui-cell span img {
			display: block;
			width: 100%;
		}
		.my-weui-btn {
			display:block;
			width: 100%;
			height: 100%;
			text-align: center;
			background-color: red;
			line-height: 42px;
			font-size: 21px;
			color: #fff;
		}
		.my-div {
			width: 100%;
			height: 40px;
		}
		.my-foot {
			position:fixed;
			width: 100%;
			height: 42px;
			bottom:0px;
			background-color: red;
			text-align: center;
		}
</style>
<body>
<div class="weui-content">
	<div class="weui-cell">
    	<div class="weui-cell__hd"><label for="" class="weui-label">订单编号:</label></div>
    	<div class="weui-cell__bd">
     	 <span id="my_id">${order.id}</span>
    	</div>
  	</div>
  	<div class="weui-cell">
    	<div class="weui-cell__hd"><label for="" class="weui-label">产品名称:</label></div>
    	<div class="weui-cell__bd">
     	 <span>${order.goodsName}</span>
    	</div>
  	</div>
  	<div class="weui-cell">
    	<div class="weui-cell__hd"><label for="" class="weui-label">购买数量:</label></div>
    	<div class="weui-cell__bd">
     	 <span>${order.orderSum}</span>
    	</div>
  	</div>
  	<div class="weui-cell">
    	<div class="weui-cell__hd"><label for="" class="weui-label">总价格:</label></div>
    	<div class="weui-cell__bd">
     	 <span style="color: red;">￥${order.orderTotal}</span>
    	</div>
  	</div>
  	<div class="weui-cell">
    	<div class="weui-cell__hd"><label for="" class="weui-label">产品图片:</label></div>
    	<div class="weui-cell__bd">
     	 <span><img src="${order.goodsPic}" /></span>
    	</div>
  	</div>
  	<div class="weui-cell">
	    	<div class="weui-cell__hd"><label for="" class="weui-label">订单状态:</label></div>
	    	<div class="weui-cell__bd">
	     	 <span>
	     	 	<c:if test="${order.orderState eq '1'}">
	   			未支付
	   			</c:if>
	   			<c:if test="${order.orderState eq '2'}">
	   			未审核
	   			</c:if>
	   			<c:if test="${order.orderState eq '3'}">
	   			已审核
	   			</c:if>
	   			<c:if test="${order.orderState eq '4'}">
	   				未发货
	   			</c:if>
	   			<c:if test="${order.orderState eq '5'}">
	   				已发货
	   			</c:if>
	   			<c:if test="${order.orderState eq '6'}">
	   				已发货
	   			</c:if>
	   			<c:if test="${order.orderState eq '7'}">
	   				已退款
	   			</c:if>
	   			<c:if test="${order.orderState eq '8'}">
	   				未通过审核
	   			</c:if>
	     	 </span>
    	</div>
  	</div>
  	<div class="weui-cell">
	    	<div class="weui-cell__hd"><label for="" class="weui-label">购买人:</label></div>
	    	<div class="weui-cell__bd">
	     	 <span>${order.weName}</span>
    	</div>
  	</div>
  	<div class="weui-cell">
	    	<div class="weui-cell__hd"><label for="" class="weui-label">购买时间:</label></div>
	    	<div class="weui-cell__bd">
	     	 <span><fmt:formatDate value="${order.updateTime}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
    	</div>
  	</div>
  	<c:choose>
  		<c:when test="${not empty order.orderYuliu}">
  		<div class="weui-cell">
	    	<div class="weui-cell__hd"><label for="" class="weui-label">药店名称:</label></div>
	    	<div class="weui-cell__bd">
	     	 <span>${order.houseName}</span>
    		</div>
  		</div>
  		<div class="weui-cell">
	    	<div class="weui-cell__hd"><label for="" class="weui-label">药店地址:</label></div>
	    	<div class="weui-cell__bd">
	     	 <span>${order.houseAddress}</span>
    		</div>
  		</div>
  		</c:when>
  		<c:otherwise>
  		<div class="weui-cell">
	    	<div class="weui-cell__hd"><label for="" class="weui-label">收货人:</label></div>
	    	<div class="weui-cell__bd">
	     	 <span>${order.receiptName}</span>
    		</div>
      	</div>
      	<div class="weui-cell">
	    	<div class="weui-cell__hd"><label for="" class="weui-label">收货地址:</label></div>
	    	<div class="weui-cell__bd">
	     	 <span>${order.addressDetail}</span>
    		</div>
      	</div>
  		</c:otherwise>
  	</c:choose>
  	<div class="weui-cell">
		<div style="color: red">确认收货后，商家将不配送药品，请确认您是否收到药品，再选择确认收货!</div>
	</div>
</div>
<div class="my-div">
</div>
<div class="my-foot">
	<a href="javascript:;" class="my-weui-btn" id="my_sure">确认收货</a>
</div>
<jsp:include page="foot.jsp"></jsp:include>
<script type="text/javascript">
	$('#my_sure').click(function(){
		var id=$('#my_id').html();
		 var url="/phone/orderChange?id="+id;
		$.get(url,function(data){
			if('ok'==data){
				window.location.href="/phone/shop";
			}else{
				$.toast("操作失败!","text");
			}
		}); 
	});
</script>
</body>
</html>